﻿
/*----------------------------------------------------------------//
// 文件名：MoTester.cs
// 文件功能描述：实体 MoTester.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTester
using System;
using System.Data;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoTester
	/// </summary>
	public partial class MoTester:ICloneable
	{
		#region 表Tester的字段
		private string coItemId;
		private string empId;
		private string dutyCode;
		private decimal dutyWeight;
		#endregion
		
		#region 构造函数
		public MoTester()
		{
			     	    
		   
		}
		#endregion
		
		#region 拷贝构造函数

		public MoTester(MoTester item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoTester(string coItemId,string empId,string dutyCode,decimal dutyWeight)
		{
		this.coItemId=coItemId;
		this.empId=empId;
		this.dutyCode=dutyCode;
		this.dutyWeight=dutyWeight;
		}
		#endregion
		
		#region 表Tester的字段属性
		/// <summary>
		/// CO_ITEM_ID
		/// </summary>
		public string CoItemId
		{
			get {return coItemId;}
			set {coItemId=value;}
		}
		/// <summary>
		///人员序号是自增序列。人员编码使用触发器实现。   E0001,E0002
		/// </summary>
		public string EmpId
		{
			get {return empId;}
			set {empId=value;}
		}
		/// <summary>
		///用以区别是主管实验员，还是辅助实验员，还是其他什么身份；
		/// </summary>
		public string DutyCode
		{
			get {return dutyCode;}
			set {dutyCode=value;}
		}
		/// <summary>
		///  .
		/// </summary>
		public decimal DutyWeight
		{
			get {return dutyWeight;}
			set {dutyWeight=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoTester CopyTo(MoTester item)
        {
		    item.coItemId=this.coItemId;
		    item.empId=this.empId;
		    item.dutyCode=this.dutyCode;
		    item.dutyWeight=this.dutyWeight;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoTester mo=new MoTester();
		    mo.CoItemId=this.CoItemId;
		    mo.EmpId=this.EmpId;
		    mo.DutyCode=this.DutyCode;
		    mo.DutyWeight=this.DutyWeight;
			return mo;
		}
				///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {		 
            if (object.ReferenceEquals(this,obj))
            {
                return true;
            }
            else
            {
                MoTester NewTester = obj as MoTester;
                if (NewTester == null)
                {
                    return false;
                }
                else
                {
				if (NewTester.CoItemId==this.CoItemId && NewTester.EmpId==this.EmpId && NewTester.DutyCode==this.DutyCode && NewTester.DutyWeight==this.DutyWeight)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format(System.Globalization.CultureInfo.InvariantCulture,"CoItemId={0}/EmpId={1}/DutyCode={2}/DutyWeight={3}",coItemId,empId,dutyCode,dutyWeight);
		 
		}
		#endregion
		
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Co_Item_ID"]!=null && row["Co_Item_ID"]!=DBNull.Value)
			{
			    this.CoItemId = (string)row["Co_Item_ID"];
			}
			else
			{
				this.CoItemId =string.Empty;
			}
		    if(row["Emp_ID"]!=null && row["Emp_ID"]!=DBNull.Value)
			{
			    this.EmpId = (string)row["Emp_ID"];
			}
			else
			{
				this.EmpId =string.Empty;
			}
		    if(row["Duty_Code"]!=null && row["Duty_Code"]!=DBNull.Value)
			{
			    this.DutyCode = (string)row["Duty_Code"];
			}
			else
			{
				this.DutyCode =string.Empty;
			}
		    if(row["Duty_Weight"]!=null && row["Duty_Weight"]!=DBNull.Value)
			{
			    this.DutyWeight = (decimal)row["Duty_Weight"];
			}
			else
			{
				this.DutyWeight =0;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Co_Item_ID"] = this.CoItemId;
			row["Emp_ID"] = this.EmpId;
			row["Duty_Code"] = this.DutyCode;
			row["Duty_Weight"] = this.DutyWeight;
		}
		#endregion
	}
}
#endregion
